#pragma once

#include "gui2d_global.h"
#include <osgWidget/Box>
#include "osgbuttonbase.h"

namespace osg
{
	class Camera;
}

namespace Gui2D
{
	class GUI2D_EXPORT OsgButton: public OsgButtonBase
	{
	public:
		OsgButton();
		virtual ~OsgButton();
		virtual void updataEffect();
		osgWidget::Box* createButtonBox(const std::string& name,const QString& theme,const std::string& text,int width,
			int height,GuiOpEventEffectType type = DEFAULT_NONE);
		osgWidget::Box* getButtonBox();
		void addIntoScene(bool inscene)
		{
			_inScene = inscene;
		}
		virtual void setDefaultSize(int width,int height);
		virtual void setPosition(int x,int y,int z = 0);
		virtual void getPosition(int& x,int& y,int& z);
	protected:
		virtual bool SizeChangedEffect(osgWidget::Event& ev);
		virtual bool SizeChangedDefault(osgWidget::Event& ev);
	private:
		osg::ref_ptr<osgWidget::Box>			_box;
		bool									_startUpdata;
	};
}